<%@page import="java.util.Iterator"%>
<%@page import="com.lzl.entity.Goods"%>
<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insert title here</title>
</head>
<body>
<%
if(session.getAttribute("username")==null)
	response.sendRedirect("login.jsp");
%>
<%
	List<Goods> glist = (ArrayList<Goods>)request.getAttribute("glist");
%>
<table border="1" width="100%">
<tr><th colspan="4" Height="50px">零食电商后台管理系统</th></tr>
<tr><td width="30%" Height="30px"><a href="goodaction.jsp">商品管理</a></td>
<td rowspan="4">
<table border="1">
<tr><th>商品编号</th><th>商品名称</th><th>商品价格</th><th>商品类别</th><th>操作</th></tr>
<%
		Iterator<Goods> iter = glist.iterator();
		Goods g = null;
		while(iter.hasNext()) {
			g = iter.next();
		
	%>
	<tr><td><%=g.getSnack_number()%></td><td><%=g.getSnack_name()%></td><td><%=g.getSnack_price()%></td><td><%=g.getSnack_class()%></td><td><a href="deletegoods.jsp?snack_number=<%=g.getSnack_number()%>">删除</a>      <a href="updategoods.jsp?snack_number=<%=g.getSnack_number()%>">修改</a></td></tr>
	<%
		}
	%>
</table>
</td>
</tr>
<tr><td width="20%" Height="30px"><a href="insertgoods.jsp">商品添加</a></td></tr>
<tr><td width="20%" Height="30px"><a href="updatepwd.jsp">修改密码</a></td></tr>
<tr><td width="20%" Height="30px"><a href="leave.jsp">系统退出</a></td></tr>
</table>
</body>
</html>